#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Ankele'

import sys

import turtle as t

# input your codes
def p_curve():
    MAX_DIS = 1000
    MAX_COUNT = 150
    dis = 3

    t.setup(MAX_DIS, MAX_DIS, 500, 500)
    t.pensize(6)
    t.pencolor('black')
    t.hideturtle()
    t.speed('fastest')

    while True:
        t.forward(dis)
        t.left(90)

        if dis > MAX_DIS:
            break

        dis += _get_added(dis)

def _get_added(n):
    if n < 6:
        return n-1
    for i in range(n/2):
        if i*i >= n:
            return i
    raise Exception('Get added error...')


def main(argv=sys.argv):
    p_curve()
    if raw_input('Input everything to continue: ') is not None:
        return 0
    return 1


if __name__ == '__main__':
    sys.exit(main())